<%@ page import="java.util.List"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="com.hargasembako.core.entity.*"%>
<%
	List<Store> stores = (List<Store>) request.getAttribute("stores");
%>
<html>
<head>
<title>Harga Sembako - List Store</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" />
</head>
<body>
	<span class="title">Store List</span>
	<p />
	<a	href="store?action=storeCreate">Create a new Store</a>
	<%
		if (stores.size() > 0) {
	%>
	<br>
	<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">
		<tr bgcolor="#407BA8">
			<td style="color: #ffffff; font-weight: bold;">ID</td>
			<td style="color: #ffffff; font-weight: bold;">Name</td>
			<td style="color: #ffffff; font-weight: bold;">Address</td>
			<td style="color: #ffffff; font-weight: bold;">City</td>
		</tr>
		<%
			for (int i = 0; i < stores.size(); i++) {
		%>
		<%
			Store o = (Store) stores.get(i);
		%>
		<tr style="background: #ffffff"
			onMouseOver="this.style.background='#eeeeee';"
			onMouseOut="this.style.background='#ffffff';">
			<td nowrap><%=o.getId()%></td>
			<td>
				<a href="store?action=storeEdit&storeId=<%= o.getId() %>">
				<%=o.getName() %>
				</a>			
			</td>
			<td><%=o.getAddress()%></td>
			<td><%=o.getCity()%></td>
		</tr>
		<%
			}
		%>
	</table>
	<%
		} else {
	%>
	<p />
	<span class="heading">No Store found.</span>
	<%
		}
	%>
</body>
</html>
